import BGMManager from "../../../core/bgm_manager";
import GameTask from "../../../core/game_task";
const { ccclass, property } = cc._decorator;
@ccclass
export default class GameTaskInit extends GameTask {
    async onInit() {
        console.log("game_task_init 运行成功");

        BGMManager.ins.play("bgm");

        // // 避免控制台乱报错。
        if (CC_PREVIEW) {
            // 预览调试时, 跳过log.
            // CCDebug, DebugInfos,

            //@ts-ignore
            let cclogid = cc.logID;
            //@ts-ignore
            cc.logID = function () {
                if (arguments[0] == 1613) return;
                cclogid.apply(null, arguments);
            };

            let ccerror = cc.error;
            cc.error = function () {
                let formatStr = arguments[0];
                if (typeof formatStr == "string") {
                    if (formatStr.includes("is removed")) {
                        return;
                    }
                }
                ccerror.apply(null, arguments);
            };
        }
    }
};  